import request from '@/utils/request'

export const reqPageSpu=(page,limit,category3Id)=>{
    return request({
        url:`/admin/product/${page}/${limit}`,
        method:'get',
        params:{
            category3Id
        }
    })
}

export const reqSpuMsg=(spuId)=>{
    return request({
        url:`/admin/product/getSpuById/${spuId}`,
        method:'get'
    })
}

export const reqSpuList=()=>{
    return request({
        url:'/admin/product/baseTrademark/getTrademarkList',
        method:'get'
    })
}

export const reqSpuimg=(spuId)=>{
    return request({
        url:`/admin/product/spuImageList/${spuId}`,
        method:'get'
    })
}

export const reqAllAttribute=()=>{
    return request({
        url:'/admin/product/baseSaleAttrList',
        method:'get'
    })
}

export const reqSpuInfo = (data)=>{
    let str = data.id ? "updateSpuInfo":'saveSpuInfo'
        return request({
        url:`/admin/product/${str}`,
        method:'post',
        data
    })
    
}

export const reqDelSpu = (spuId) =>{
    return request({
        url:`/admin/product/deleteSpu/${spuId}`,
        method:'DELETE'
    })
}

export const reqFindSpuld = (spuId)=>{
    return request({
        url:`/admin/product/findBySpuId/${spuId}`,
        method:"get"
    })
}